/**
 * 1、class类的只读修饰符：readonly
 *    表示只读，用来防止在构造函数之外对属性进行赋值
 *    只能修饰类里面的属性，不能修饰方法
 */
//只读方式，只能由构造函数来改变属性的值
var Person = /** @class */ (function () {
    function Person(age) {
        this.age = 18;
        this.age = age;
    }
    return Person;
}());
var a = new Person(23);
// console.log(a.age);
//不加readonly
var Person1 = /** @class */ (function () {
    function Person1(age) {
        this.age = 18;
        this.age = age;
    }
    Person1.prototype.changeAge = function () {
        this.age = 21;
    };
    return Person1;
}());
var a1 = new Person1(23);
console.log(a1.changeAge());
